package com.esdc.librarysystem.datastate;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author shou1dwe
 */
public class BookLoanState implements Serializable{
    private Long id;
    private Integer copyNumber;
    private String title;
    private String author;
    private String publisher;
    private Date dueDate;

    public BookLoanState(Long id, Integer copyNumber, String title, String author, String publisher, Date dueDate) {
        this.id = id;
        this.copyNumber = copyNumber;
        this.title = title;
        this.author = author;
        this.publisher = publisher;
        this.dueDate = dueDate;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the copyNumber
     */
    public Integer getCopyNumber() {
        return copyNumber;
    }

    /**
     * @param copyNumber the copyNumber to set
     */
    public void setCopyNumber(Integer copyNumber) {
        this.copyNumber = copyNumber;
    }

    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @return the author
     */
    public String getAuthor() {
        return author;
    }

    /**
     * @param author the author to set
     */
    public void setAuthor(String author) {
        this.author = author;
    }

    /**
     * @return the publisher
     */
    public String getPublisher() {
        return publisher;
    }

    /**
     * @param publisher the publisher to set
     */
    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    /**
     * @return the dueDate
     */
    public Date getDueDate() {
        return dueDate;
    }

    /**
     * @param dueDate the dueDate to set
     */
    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    @Override
    public String toString(){
        return String.format("(%d) Title: %s by %s (%s) Due: %s", id, title, author, publisher, dueDate);
    }
}
